const logger = require('log4js').getLogger()
const config = require('../util/config')

exports.start = (priority) => {
    //require('../util/getHtml')({
    //    url: 'http://127.0.0.1:4040/inspect/http'
    //}).then(result => {
    //var urls = result.match(/http:\/\/.{8}.ngrok.io/g)
    var urls = [config.local.chromeServer]
    if (urls.length > 0) {
        for (var i = 0; i < urls.length; i++)
            urls[i] += '/'
        require('../util/getHtml')({
            url: 'https://etourly.com/addChromeServer.do',
            data: JSON.stringify({
                urls: urls,
                priority
            })
        }).then(result => {
		}, result => {
			logger.error('[' + __filename + ':' + __line + ']', result)
		})
    }
    //}, result => {
    //})
}
